{extend name="../../base/view/common/base" /}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-page">
	<h3 class="pb-3">定时任务</h3>
	<table class="layui-table layui-table-form">
		<tr>
			<td colspan="4"><strong class="red">注意：定时任务目前只是记录，具体需要技术人员自行在系统服务器添加定时任务计划。</strong></td>
		</tr>
		<tr>
			<td class="layui-td-gray">任务名称<font>*</font></td>
			<td>
				<input type="hidden" name="id" value="{$id}" />
				<input type="hidden" name="type" value="3" />
				<input type="text" name="title" lay-verify="required" autocomplete="off" placeholder="请输入任务名称" lay-reqText="请输入任务名称" class="layui-input" value="{$task.title|default=''}">
			</td>
			<td class="layui-td-gray-2">任务访问链接<font>*</font></td>
			<td>
				<input type="text" name="link" lay-verify="required" autocomplete="off" placeholder="请输入任务访问链接" lay-reqText="请输入任务访问链接" class="layui-input" value="{$task.link|default=''}">
			</td>
		</tr>
		<tr>
			<td class="layui-td-gray">任务描述</td>
			<td colspan="3">
				<textarea name="desc" placeholder="请输入任务描述，不能超过200个字" class="layui-textarea">{$task.desc|default=''}</textarea>
			</td>
		</tr>
	</table>
	<div class="pt-4">
		<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
		<button type="reset" class="layui-btn layui-btn-primary">重置</button>
	</div>
</form>
{/block}
<!-- /主体 -->

<!-- 脚本 -->
{block name="script"}
<script>
	const moduleInit = ['tool'];
	function gouguInit() {
		var form = layui.form, tool = layui.tool;
		//监听提交
		form.on('submit(webform)', function (data) {
			let callback = function (e) {
				layer.msg(e.msg);
				if (e.code == 0) {
					tool.sideClose(1000);
				}
			}
			let clickbtn = $(this);
			tool.post("/home/task/add", data.field, callback,clickbtn);
			return false;
		});
	}
</script>
{/block}
<!-- /脚本 -->